﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using LiveSequence.Suite.Interfaces;
using WeifenLuo.WinFormsUI.Docking;


namespace LiveSequence.Suite.Views
{
  internal partial class PropertyView : UserControl
  {
    public PropertyView()
    {
      InitializeComponent();

      PropertyViewManager.Instance.SelectedObjectChanged += new EventHandler(PropertyViewManager_SelectedObjectChanged);
      PropertyViewManager.Instance.Refresh += new EventHandler(PropertyViewManager_Refresh);
    }

    void PropertyViewManager_Refresh(object sender, EventArgs e)
    {
      _propertyGrid.Refresh();
    }

    void PropertyViewManager_SelectedObjectChanged(object sender, EventArgs e)
    {
      _propertyGrid.SelectedObject = PropertyViewManager.Instance.SelectedObject;
    }

    private void _propertyGrid_PropertyValueChanged(object s, PropertyValueChangedEventArgs e)
    {
      PropertyViewManager.Instance.Update();
    }
  }
}
